<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML>
<html>
  <head>
    <base href="<%=basePath%>">
    
		<title>用户后台</title>
		<link rel="stylesheet" href="css/result.css" />
		<link rel="stylesheet" href="css/userIndex.css" />
	<script type="text/javascript" src="js/jquery-3.1.1.min.js"></script>
	<style type="text/css">
		.footer_index a{
			border:1px solid gray;
			margin:10px;
			padding:5px 12px;
			width:50px;
			height:30px;
			line-height:30px;
			font-size:18px;
		}
	</style>
	</head>
	<body>
	<form action="bugInfoController/findBugByUserId"  method="post">
	<input type="hidden" id="hidden_val" name="userId" value="${userInfo.userid }">
		<div class="main">
			<div class="top">
				<div class="left">
					<div class="img"><img src="images/ioc/head.png" width="105px" height="120px"/>
					<p>昵称:${userInfo.nickname } </p>
					<p style="width: 100px; border: 0.01px gray solid;"> </p>
					<p style="position: relative;"><span style="text-align: center;position: absolute;top: 3px;left: 0px;">认证:</span><img src="images/ioc/phone.png" style="margin-left: 20px;" /></p>
					<p><a href="jsp/back-stage/accountManager.jsp" target="_block">账号设置</a></p>
					</div>
				</div>
			</div>
			<div class="middle">
				<div class="m1">
					<div class="m1header">
						<ul>
							<li style="font-size: 16px;">搜索记录</li><li>|</li><li>我的搜索</li><li>实时热点</li>
						</ul>
					</div>
					
				</div>
				<div class="text">展示前20条数据</div>
			</div>
			<div class="clear_float"></div>
			<div class="bootom">
				<div class="b1">
					<div class="b1header">
						<ul>
							<li class="BUGList" >BUG列表</li>
							<li class="addBUG" onclick="location.href='jsp/addBugInfo.jsp'">添加BUG</li>
						</ul>
					</div>
				</div>
				<div class="showInfo" style="height:240px;" >
					<div >
					<table style="width:1000px;text-align:center;padding:0px;margin-top:0px"  class="append_info">
						<tr style="background-color:gray;height:30px">
							<td>序号</td>
							<td>BUG摘要</td>
							<td>添加时间</td>
							<td>查询次数</td>
							<td>操作</td>
						</tr>
						<c:forEach items="${list }" var="li" varStatus="number">
							<tr style='width:100%;height:30px;line-height:30px;'>
								<td>${number.count }</td>
								<td>${li.description }</td>
								<td>${li.addTime }</td>
								<td>${li.queriesnumber }</td>
								<td><a href="bugInfoController/deleteByBugId?bugId=${li.bugId }">删除</a> 
								 <a href="bugInfoController/findByBugId?bugId=${li.bugId }">修改</a></td>
							</tr>
						</c:forEach>
						
					</table>
					</div>
					<div style="text-align:center;margin-top:5px" class="footer_index">
							<c:forEach items="${pageNumber }" var="li" varStatus="number">
								<a href="bugInfoController/findBugByUserId?indexSize=${number.count }&userId=${userInfo.userid}">${number.count }</a>
							</c:forEach>
					</div>
				</div>
			</div>
			<div style="height:100px"></div>
		</div>
		</form>
		<script type="text/javascript">
			var color=$("li").css("background-color");
			$("li").mouseover(function(){
				$(this).css("background-color","yellow");
				$(this).css("curson","pointer");
			});
			$("li").mouseout(function(){
			
				$(this).css("background-color",color);
			});
		</script>
		<!-- <script type="text/javascript">
				$(function(){
					var userId=$("#hidden_val").val();
					$.ajax({
						url:"bugInfoController/findBugByUserId/"+userId,
						success:function(msg){
							var str=eval('(' + msg + ')');
							console.log(str.length);
							if(str!=null){
								for(var i=0;i < str.length;i++){
									var obj=str[i];
									$(".append_info").append("<tr style='width:100%;height:30px;line-height:30px;'><td>"+(i+1)+"</td><td>"+obj['description']+"</td><td>"+obj['addTime']+"</td><td>"+obj['queriesnumber']+"</td><td><a>删除</a>  <a>修改</a></td></tr>");
								}
							}
						}
					});
				});
		</script> -->
		<script type="text/javascript">
			$(".BUGList").on("click",function(){ 				
				 $("form").submit(); 
			});  
			$(".addBUG").on("click",function(){
				$(".showInfo").hide();
			});
		</script>
	</body>
</html>